/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.cmc.service.merchant.model.impl;

import com.cmc.service.merchant.model.MerchantEntry;
import com.cmc.service.merchant.model.MerchantEntryModel;
import com.cmc.service.merchant.model.MerchantEntrySoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSON;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import java.io.Serializable;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * The base model implementation for the MerchantEntry service. Represents a row in the &quot;CTI_MerchantEntry&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.cmc.service.merchant.model.MerchantEntryModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link MerchantEntryImpl}.
 * </p>
 *
 * @author ntcuong1
 * @see MerchantEntryImpl
 * @see com.cmc.service.merchant.model.MerchantEntry
 * @see com.cmc.service.merchant.model.MerchantEntryModel
 * @generated
 */
@JSON(strict = true)
public class MerchantEntryModelImpl extends BaseModelImpl<MerchantEntry>
	implements MerchantEntryModel {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this class directly. All methods that expect a merchant entry model instance should use the {@link com.cmc.service.merchant.model.MerchantEntry} interface instead.
	 */
	public static final String TABLE_NAME = "CTI_MerchantEntry";
	public static final Object[][] TABLE_COLUMNS = {
			{ "merchantId", Types.BIGINT },
			{ "companyId", Types.BIGINT },
			{ "creatorUserId", Types.BIGINT },
			{ "createDate", Types.TIMESTAMP },
			{ "modifiedDate", Types.TIMESTAMP },
			{ "type_", Types.VARCHAR },
			{ "code_", Types.VARCHAR },
			{ "title", Types.VARCHAR },
			{ "description", Types.VARCHAR },
			{ "organization", Types.BOOLEAN },
			{ "organizationId", Types.BIGINT },
			{ "organizationType", Types.VARCHAR },
			{ "organizationStatus", Types.INTEGER },
			{ "sites", Types.BOOLEAN },
			{ "recursable", Types.BOOLEAN },
			{ "countryId", Types.BIGINT },
			{ "regionId", Types.BIGINT },
			{ "longitude", Types.DOUBLE },
			{ "latitude", Types.DOUBLE },
			{ "parentId", Types.BIGINT }
		};
	public static final String TABLE_SQL_CREATE = "create table CTI_MerchantEntry (merchantId LONG not null primary key,companyId LONG,creatorUserId LONG,createDate DATE null,modifiedDate DATE null,type_ VARCHAR(75) null,code_ VARCHAR(75) null,title VARCHAR(75) null,description VARCHAR(75) null,organization BOOLEAN,organizationId LONG,organizationType VARCHAR(75) null,organizationStatus INTEGER,sites BOOLEAN,recursable BOOLEAN,countryId LONG,regionId LONG,longitude DOUBLE,latitude DOUBLE,parentId LONG)";
	public static final String TABLE_SQL_DROP = "drop table CTI_MerchantEntry";
	public static final String ORDER_BY_JPQL = " ORDER BY merchantEntry.title ASC, merchantEntry.code ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CTI_MerchantEntry.title ASC, CTI_MerchantEntry.code_ ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.cmc.service.merchant.model.MerchantEntry"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.cmc.service.merchant.model.MerchantEntry"),
			true);
	public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.column.bitmask.enabled.com.cmc.service.merchant.model.MerchantEntry"),
			true);
	public static long CODE_COLUMN_BITMASK = 1L;
	public static long COMPANYID_COLUMN_BITMASK = 2L;
	public static long PARENTID_COLUMN_BITMASK = 4L;
	public static long TYPE_COLUMN_BITMASK = 8L;

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static MerchantEntry toModel(MerchantEntrySoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		MerchantEntry model = new MerchantEntryImpl();

		model.setMerchantId(soapModel.getMerchantId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setCreatorUserId(soapModel.getCreatorUserId());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setType(soapModel.getType());
		model.setCode(soapModel.getCode());
		model.setTitle(soapModel.getTitle());
		model.setDescription(soapModel.getDescription());
		model.setOrganization(soapModel.getOrganization());
		model.setOrganizationId(soapModel.getOrganizationId());
		model.setOrganizationType(soapModel.getOrganizationType());
		model.setOrganizationStatus(soapModel.getOrganizationStatus());
		model.setSites(soapModel.getSites());
		model.setRecursable(soapModel.getRecursable());
		model.setCountryId(soapModel.getCountryId());
		model.setRegionId(soapModel.getRegionId());
		model.setLongitude(soapModel.getLongitude());
		model.setLatitude(soapModel.getLatitude());
		model.setParentId(soapModel.getParentId());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<MerchantEntry> toModels(MerchantEntrySoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<MerchantEntry> models = new ArrayList<MerchantEntry>(soapModels.length);

		for (MerchantEntrySoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.cmc.service.merchant.model.MerchantEntry"));

	public MerchantEntryModelImpl() {
	}

	public long getPrimaryKey() {
		return _merchantId;
	}

	public void setPrimaryKey(long primaryKey) {
		setMerchantId(primaryKey);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_merchantId);
	}

	public void setPrimaryKeyObj(Serializable primaryKeyObj) {
		setPrimaryKey(((Long)primaryKeyObj).longValue());
	}

	public Class<?> getModelClass() {
		return MerchantEntry.class;
	}

	public String getModelClassName() {
		return MerchantEntry.class.getName();
	}

	@Override
	public Map<String, Object> getModelAttributes() {
		Map<String, Object> attributes = new HashMap<String, Object>();

		attributes.put("merchantId", getMerchantId());
		attributes.put("companyId", getCompanyId());
		attributes.put("creatorUserId", getCreatorUserId());
		attributes.put("createDate", getCreateDate());
		attributes.put("modifiedDate", getModifiedDate());
		attributes.put("type", getType());
		attributes.put("code", getCode());
		attributes.put("title", getTitle());
		attributes.put("description", getDescription());
		attributes.put("organization", getOrganization());
		attributes.put("organizationId", getOrganizationId());
		attributes.put("organizationType", getOrganizationType());
		attributes.put("organizationStatus", getOrganizationStatus());
		attributes.put("sites", getSites());
		attributes.put("recursable", getRecursable());
		attributes.put("countryId", getCountryId());
		attributes.put("regionId", getRegionId());
		attributes.put("longitude", getLongitude());
		attributes.put("latitude", getLatitude());
		attributes.put("parentId", getParentId());

		return attributes;
	}

	@Override
	public void setModelAttributes(Map<String, Object> attributes) {
		Long merchantId = (Long)attributes.get("merchantId");

		if (merchantId != null) {
			setMerchantId(merchantId);
		}

		Long companyId = (Long)attributes.get("companyId");

		if (companyId != null) {
			setCompanyId(companyId);
		}

		Long creatorUserId = (Long)attributes.get("creatorUserId");

		if (creatorUserId != null) {
			setCreatorUserId(creatorUserId);
		}

		Date createDate = (Date)attributes.get("createDate");

		if (createDate != null) {
			setCreateDate(createDate);
		}

		Date modifiedDate = (Date)attributes.get("modifiedDate");

		if (modifiedDate != null) {
			setModifiedDate(modifiedDate);
		}

		String type = (String)attributes.get("type");

		if (type != null) {
			setType(type);
		}

		String code = (String)attributes.get("code");

		if (code != null) {
			setCode(code);
		}

		String title = (String)attributes.get("title");

		if (title != null) {
			setTitle(title);
		}

		String description = (String)attributes.get("description");

		if (description != null) {
			setDescription(description);
		}

		Boolean organization = (Boolean)attributes.get("organization");

		if (organization != null) {
			setOrganization(organization);
		}

		Long organizationId = (Long)attributes.get("organizationId");

		if (organizationId != null) {
			setOrganizationId(organizationId);
		}

		String organizationType = (String)attributes.get("organizationType");

		if (organizationType != null) {
			setOrganizationType(organizationType);
		}

		Integer organizationStatus = (Integer)attributes.get(
				"organizationStatus");

		if (organizationStatus != null) {
			setOrganizationStatus(organizationStatus);
		}

		Boolean sites = (Boolean)attributes.get("sites");

		if (sites != null) {
			setSites(sites);
		}

		Boolean recursable = (Boolean)attributes.get("recursable");

		if (recursable != null) {
			setRecursable(recursable);
		}

		Long countryId = (Long)attributes.get("countryId");

		if (countryId != null) {
			setCountryId(countryId);
		}

		Long regionId = (Long)attributes.get("regionId");

		if (regionId != null) {
			setRegionId(regionId);
		}

		Double longitude = (Double)attributes.get("longitude");

		if (longitude != null) {
			setLongitude(longitude);
		}

		Double latitude = (Double)attributes.get("latitude");

		if (latitude != null) {
			setLatitude(latitude);
		}

		Long parentId = (Long)attributes.get("parentId");

		if (parentId != null) {
			setParentId(parentId);
		}
	}

	@JSON
	public long getMerchantId() {
		return _merchantId;
	}

	public void setMerchantId(long merchantId) {
		_merchantId = merchantId;
	}

	@JSON
	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_columnBitmask |= COMPANYID_COLUMN_BITMASK;

		if (!_setOriginalCompanyId) {
			_setOriginalCompanyId = true;

			_originalCompanyId = _companyId;
		}

		_companyId = companyId;
	}

	public long getOriginalCompanyId() {
		return _originalCompanyId;
	}

	@JSON
	public long getCreatorUserId() {
		return _creatorUserId;
	}

	public void setCreatorUserId(long creatorUserId) {
		_creatorUserId = creatorUserId;
	}

	public String getCreatorUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getCreatorUserId(), "uuid",
			_creatorUserUuid);
	}

	public void setCreatorUserUuid(String creatorUserUuid) {
		_creatorUserUuid = creatorUserUuid;
	}

	@JSON
	public Date getCreateDate() {
		return _createDate;
	}

	public void setCreateDate(Date createDate) {
		_createDate = createDate;
	}

	@JSON
	public Date getModifiedDate() {
		return _modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		_modifiedDate = modifiedDate;
	}

	@JSON
	public String getType() {
		if (_type == null) {
			return StringPool.BLANK;
		}
		else {
			return _type;
		}
	}

	public void setType(String type) {
		_columnBitmask |= TYPE_COLUMN_BITMASK;

		if (_originalType == null) {
			_originalType = _type;
		}

		_type = type;
	}

	public String getOriginalType() {
		return GetterUtil.getString(_originalType);
	}

	@JSON
	public String getCode() {
		if (_code == null) {
			return StringPool.BLANK;
		}
		else {
			return _code;
		}
	}

	public void setCode(String code) {
		_columnBitmask = -1L;

		if (_originalCode == null) {
			_originalCode = _code;
		}

		_code = code;
	}

	public String getOriginalCode() {
		return GetterUtil.getString(_originalCode);
	}

	@JSON
	public String getTitle() {
		if (_title == null) {
			return StringPool.BLANK;
		}
		else {
			return _title;
		}
	}

	public void setTitle(String title) {
		_columnBitmask = -1L;

		_title = title;
	}

	@JSON
	public String getDescription() {
		if (_description == null) {
			return StringPool.BLANK;
		}
		else {
			return _description;
		}
	}

	public void setDescription(String description) {
		_description = description;
	}

	@JSON
	public boolean getOrganization() {
		return _organization;
	}

	public boolean isOrganization() {
		return _organization;
	}

	public void setOrganization(boolean organization) {
		_organization = organization;
	}

	@JSON
	public long getOrganizationId() {
		return _organizationId;
	}

	public void setOrganizationId(long organizationId) {
		_organizationId = organizationId;
	}

	@JSON
	public String getOrganizationType() {
		if (_organizationType == null) {
			return StringPool.BLANK;
		}
		else {
			return _organizationType;
		}
	}

	public void setOrganizationType(String organizationType) {
		_organizationType = organizationType;
	}

	@JSON
	public int getOrganizationStatus() {
		return _organizationStatus;
	}

	public void setOrganizationStatus(int organizationStatus) {
		_organizationStatus = organizationStatus;
	}

	@JSON
	public boolean getSites() {
		return _sites;
	}

	public boolean isSites() {
		return _sites;
	}

	public void setSites(boolean sites) {
		_sites = sites;
	}

	@JSON
	public boolean getRecursable() {
		return _recursable;
	}

	public boolean isRecursable() {
		return _recursable;
	}

	public void setRecursable(boolean recursable) {
		_recursable = recursable;
	}

	@JSON
	public long getCountryId() {
		return _countryId;
	}

	public void setCountryId(long countryId) {
		_countryId = countryId;
	}

	@JSON
	public long getRegionId() {
		return _regionId;
	}

	public void setRegionId(long regionId) {
		_regionId = regionId;
	}

	@JSON
	public double getLongitude() {
		return _longitude;
	}

	public void setLongitude(double longitude) {
		_longitude = longitude;
	}

	@JSON
	public double getLatitude() {
		return _latitude;
	}

	public void setLatitude(double latitude) {
		_latitude = latitude;
	}

	@JSON
	public long getParentId() {
		return _parentId;
	}

	public void setParentId(long parentId) {
		_columnBitmask |= PARENTID_COLUMN_BITMASK;

		if (!_setOriginalParentId) {
			_setOriginalParentId = true;

			_originalParentId = _parentId;
		}

		_parentId = parentId;
	}

	public long getOriginalParentId() {
		return _originalParentId;
	}

	public long getColumnBitmask() {
		return _columnBitmask;
	}

	@Override
	public ExpandoBridge getExpandoBridge() {
		return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
			MerchantEntry.class.getName(), getPrimaryKey());
	}

	@Override
	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		ExpandoBridge expandoBridge = getExpandoBridge();

		expandoBridge.setAttributes(serviceContext);
	}

	@Override
	public MerchantEntry toEscapedModel() {
		if (_escapedModelProxy == null) {
			_escapedModelProxy = (MerchantEntry)ProxyUtil.newProxyInstance(_classLoader,
					_escapedModelProxyInterfaces,
					new AutoEscapeBeanHandler(this));
		}

		return _escapedModelProxy;
	}

	@Override
	public Object clone() {
		MerchantEntryImpl merchantEntryImpl = new MerchantEntryImpl();

		merchantEntryImpl.setMerchantId(getMerchantId());
		merchantEntryImpl.setCompanyId(getCompanyId());
		merchantEntryImpl.setCreatorUserId(getCreatorUserId());
		merchantEntryImpl.setCreateDate(getCreateDate());
		merchantEntryImpl.setModifiedDate(getModifiedDate());
		merchantEntryImpl.setType(getType());
		merchantEntryImpl.setCode(getCode());
		merchantEntryImpl.setTitle(getTitle());
		merchantEntryImpl.setDescription(getDescription());
		merchantEntryImpl.setOrganization(getOrganization());
		merchantEntryImpl.setOrganizationId(getOrganizationId());
		merchantEntryImpl.setOrganizationType(getOrganizationType());
		merchantEntryImpl.setOrganizationStatus(getOrganizationStatus());
		merchantEntryImpl.setSites(getSites());
		merchantEntryImpl.setRecursable(getRecursable());
		merchantEntryImpl.setCountryId(getCountryId());
		merchantEntryImpl.setRegionId(getRegionId());
		merchantEntryImpl.setLongitude(getLongitude());
		merchantEntryImpl.setLatitude(getLatitude());
		merchantEntryImpl.setParentId(getParentId());

		merchantEntryImpl.resetOriginalValues();

		return merchantEntryImpl;
	}

	public int compareTo(MerchantEntry merchantEntry) {
		int value = 0;

		value = getTitle().compareTo(merchantEntry.getTitle());

		if (value != 0) {
			return value;
		}

		value = getCode().compareTo(merchantEntry.getCode());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		MerchantEntry merchantEntry = null;

		try {
			merchantEntry = (MerchantEntry)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long primaryKey = merchantEntry.getPrimaryKey();

		if (getPrimaryKey() == primaryKey) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return (int)getPrimaryKey();
	}

	@Override
	public void resetOriginalValues() {
		MerchantEntryModelImpl merchantEntryModelImpl = this;

		merchantEntryModelImpl._originalCompanyId = merchantEntryModelImpl._companyId;

		merchantEntryModelImpl._setOriginalCompanyId = false;

		merchantEntryModelImpl._originalType = merchantEntryModelImpl._type;

		merchantEntryModelImpl._originalCode = merchantEntryModelImpl._code;

		merchantEntryModelImpl._originalParentId = merchantEntryModelImpl._parentId;

		merchantEntryModelImpl._setOriginalParentId = false;

		merchantEntryModelImpl._columnBitmask = 0;
	}

	@Override
	public CacheModel<MerchantEntry> toCacheModel() {
		MerchantEntryCacheModel merchantEntryCacheModel = new MerchantEntryCacheModel();

		merchantEntryCacheModel.merchantId = getMerchantId();

		merchantEntryCacheModel.companyId = getCompanyId();

		merchantEntryCacheModel.creatorUserId = getCreatorUserId();

		Date createDate = getCreateDate();

		if (createDate != null) {
			merchantEntryCacheModel.createDate = createDate.getTime();
		}
		else {
			merchantEntryCacheModel.createDate = Long.MIN_VALUE;
		}

		Date modifiedDate = getModifiedDate();

		if (modifiedDate != null) {
			merchantEntryCacheModel.modifiedDate = modifiedDate.getTime();
		}
		else {
			merchantEntryCacheModel.modifiedDate = Long.MIN_VALUE;
		}

		merchantEntryCacheModel.type = getType();

		String type = merchantEntryCacheModel.type;

		if ((type != null) && (type.length() == 0)) {
			merchantEntryCacheModel.type = null;
		}

		merchantEntryCacheModel.code = getCode();

		String code = merchantEntryCacheModel.code;

		if ((code != null) && (code.length() == 0)) {
			merchantEntryCacheModel.code = null;
		}

		merchantEntryCacheModel.title = getTitle();

		String title = merchantEntryCacheModel.title;

		if ((title != null) && (title.length() == 0)) {
			merchantEntryCacheModel.title = null;
		}

		merchantEntryCacheModel.description = getDescription();

		String description = merchantEntryCacheModel.description;

		if ((description != null) && (description.length() == 0)) {
			merchantEntryCacheModel.description = null;
		}

		merchantEntryCacheModel.organization = getOrganization();

		merchantEntryCacheModel.organizationId = getOrganizationId();

		merchantEntryCacheModel.organizationType = getOrganizationType();

		String organizationType = merchantEntryCacheModel.organizationType;

		if ((organizationType != null) && (organizationType.length() == 0)) {
			merchantEntryCacheModel.organizationType = null;
		}

		merchantEntryCacheModel.organizationStatus = getOrganizationStatus();

		merchantEntryCacheModel.sites = getSites();

		merchantEntryCacheModel.recursable = getRecursable();

		merchantEntryCacheModel.countryId = getCountryId();

		merchantEntryCacheModel.regionId = getRegionId();

		merchantEntryCacheModel.longitude = getLongitude();

		merchantEntryCacheModel.latitude = getLatitude();

		merchantEntryCacheModel.parentId = getParentId();

		return merchantEntryCacheModel;
	}

	@Override
	public String toString() {
		StringBundler sb = new StringBundler(41);

		sb.append("{merchantId=");
		sb.append(getMerchantId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", creatorUserId=");
		sb.append(getCreatorUserId());
		sb.append(", createDate=");
		sb.append(getCreateDate());
		sb.append(", modifiedDate=");
		sb.append(getModifiedDate());
		sb.append(", type=");
		sb.append(getType());
		sb.append(", code=");
		sb.append(getCode());
		sb.append(", title=");
		sb.append(getTitle());
		sb.append(", description=");
		sb.append(getDescription());
		sb.append(", organization=");
		sb.append(getOrganization());
		sb.append(", organizationId=");
		sb.append(getOrganizationId());
		sb.append(", organizationType=");
		sb.append(getOrganizationType());
		sb.append(", organizationStatus=");
		sb.append(getOrganizationStatus());
		sb.append(", sites=");
		sb.append(getSites());
		sb.append(", recursable=");
		sb.append(getRecursable());
		sb.append(", countryId=");
		sb.append(getCountryId());
		sb.append(", regionId=");
		sb.append(getRegionId());
		sb.append(", longitude=");
		sb.append(getLongitude());
		sb.append(", latitude=");
		sb.append(getLatitude());
		sb.append(", parentId=");
		sb.append(getParentId());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(64);

		sb.append("<model><model-name>");
		sb.append("com.cmc.service.merchant.model.MerchantEntry");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>merchantId</column-name><column-value><![CDATA[");
		sb.append(getMerchantId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>creatorUserId</column-name><column-value><![CDATA[");
		sb.append(getCreatorUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createDate</column-name><column-value><![CDATA[");
		sb.append(getCreateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
		sb.append(getModifiedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>type</column-name><column-value><![CDATA[");
		sb.append(getType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>code</column-name><column-value><![CDATA[");
		sb.append(getCode());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>title</column-name><column-value><![CDATA[");
		sb.append(getTitle());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>description</column-name><column-value><![CDATA[");
		sb.append(getDescription());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>organization</column-name><column-value><![CDATA[");
		sb.append(getOrganization());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>organizationId</column-name><column-value><![CDATA[");
		sb.append(getOrganizationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>organizationType</column-name><column-value><![CDATA[");
		sb.append(getOrganizationType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>organizationStatus</column-name><column-value><![CDATA[");
		sb.append(getOrganizationStatus());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sites</column-name><column-value><![CDATA[");
		sb.append(getSites());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>recursable</column-name><column-value><![CDATA[");
		sb.append(getRecursable());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>countryId</column-name><column-value><![CDATA[");
		sb.append(getCountryId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>regionId</column-name><column-value><![CDATA[");
		sb.append(getRegionId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>longitude</column-name><column-value><![CDATA[");
		sb.append(getLongitude());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>latitude</column-name><column-value><![CDATA[");
		sb.append(getLatitude());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>parentId</column-name><column-value><![CDATA[");
		sb.append(getParentId());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private static ClassLoader _classLoader = MerchantEntry.class.getClassLoader();
	private static Class<?>[] _escapedModelProxyInterfaces = new Class[] {
			MerchantEntry.class
		};
	private long _merchantId;
	private long _companyId;
	private long _originalCompanyId;
	private boolean _setOriginalCompanyId;
	private long _creatorUserId;
	private String _creatorUserUuid;
	private Date _createDate;
	private Date _modifiedDate;
	private String _type;
	private String _originalType;
	private String _code;
	private String _originalCode;
	private String _title;
	private String _description;
	private boolean _organization;
	private long _organizationId;
	private String _organizationType;
	private int _organizationStatus;
	private boolean _sites;
	private boolean _recursable;
	private long _countryId;
	private long _regionId;
	private double _longitude;
	private double _latitude;
	private long _parentId;
	private long _originalParentId;
	private boolean _setOriginalParentId;
	private long _columnBitmask;
	private MerchantEntry _escapedModelProxy;
}